<?php
include_once('header.inc.php');
securite();
print_head();
?>
<h2>Liste d'anniversaires de <i><?php echo $_SESSION['login']; ?></i> (<?php echo $db->count($CONFIG['table_birthdays'], 'userlogin=\''.$_SESSION['login'].'\''); ?> personnes)</h2>
<table style="width:12cm"><tr><th>Nom</th><th>Date de naissance</th></tr><?php
$tab = $db->select(
'firstname, lastname,DATE_FORMAT(birthdate,\'%d\') AS dd, DATE_FORMAT(birthdate,\'%e\') AS ee, DATE_FORMAT(birthdate,\'%m\') AS mm, DATE_FORMAT(birthdate,\'%Y\') AS yyyy',
$CONFIG['table_birthdays'],
'userlogin=\''.$_SESSION['login'].'\'','mm,dd'
);
foreach($tab as $ligne)
  echo '<tr><td>'.$ligne['firstname'].' '.$ligne['lastname'].'</td><td>'.$ligne['ee'].' '.mois($ligne['mm'],false).' '.$ligne['yyyy'].'</td></tr>';
?>
</table>
<?php
include_once('footer.inc.php');
?>